import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
import {DomSanitizer} from '@angular/platform-browser';

@Component({
  selector: 'app-c-pdf',
  templateUrl: './c-pdf.component.html',
  styleUrls: ['./c-pdf.component.less']
})
export class CPdfComponent implements OnInit {
    @Output() dataChange = new EventEmitter<object>();
    @Output() onBlur = new EventEmitter<object>();

    @Input() canEdit;

    @Input() src;

    constructor(public sanitizer: DomSanitizer) { }

    ngOnInit() {
        this.src = this.sanitizer.bypassSecurityTrustResourceUrl(this.src.changingThisBreaksApplicationSecurity || 'http://hyzylab.com/pdf.pdf');
    }

    blur() {
        this.onBlur.emit();
    }

}
